/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package fuzzy.actions;

import java.math.BigDecimal;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author michal
 */
public class FuzzyForm extends org.apache.struts.action.ActionForm {
    
    private BigDecimal funNr;
    private String nazwatabeli;
    private String kolumnatabeli;
    private String nazwalingwistyczna;
    private BigDecimal wartosc;
    private BigDecimal nr;
    private boolean sent = false;

    /**
     *
     */
    public FuzzyForm() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * This is the action called from the Struts framework.
     *
     * @param mapping The ActionMapping used to select this instance.
     * @param request The HTTP Request we are processing.
     * @return
     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        if (getNazwatabeli() == null || getNazwatabeli().length() < 1) {
            errors.add("name", new ActionMessage("error.name.required"));
            // TODO: add 'error.name.required' key to your resources
        }
        return errors;
    }

    /**
     * @return the funNr
     */
    public BigDecimal getFunNr() {
        return funNr;
    }

    /**
     * @param funNr the funNr to set
     */
    public void setFunNr(BigDecimal funNr) {
        this.funNr = funNr;
    }

    /**
     * @return the nazwatabeli
     */
    public String getNazwatabeli() {
        return nazwatabeli;
    }

    /**
     * @param nazwatabeli the nazwatabeli to set
     */
    public void setNazwatabeli(String nazwatabeli) {
        this.nazwatabeli = nazwatabeli;
    }

    /**
     * @return the kolumnatabeli
     */
    public String getKolumnatabeli() {
        return kolumnatabeli;
    }

    /**
     * @param kolumnatabeli the kolumnatabeli to set
     */
    public void setKolumnatabeli(String kolumnatabeli) {
        this.kolumnatabeli = kolumnatabeli;
    }

    /**
     * @return the nazwalingwistyczna
     */
    public String getNazwalingwistyczna() {
        return nazwalingwistyczna;
    }

    /**
     * @param nazwalingwistyczna the nazwalingwistyczna to set
     */
    public void setNazwalingwistyczna(String nazwalingwistyczna) {
        this.nazwalingwistyczna = nazwalingwistyczna;
    }

    /**
     * @return the wartosc
     */
    public BigDecimal getWartosc() {
        return wartosc;
    }

    /**
     * @param wartosc the wartosc to set
     */
    public void setWartosc(BigDecimal wartosc) {
        this.wartosc = wartosc;
    }

    /**
     * @return the nr
     */
    public BigDecimal getNr() {
        return nr;
    }

    /**
     * @param nr the nr to set
     */
    public void setNr(BigDecimal nr) {
        this.nr = nr;
    }

    /**
     * @return the sent
     */
    public boolean isSent() {
        return sent;
    }

    /**
     * @param sent the sent to set
     */
    public void setSent(boolean sent) {
        this.sent = sent;
    }
}
